<!doctype html>
<html ng-app="Demo">
<head>
    <meta charset="utf-8" />
    <link href="media/css/bootstrap.min.css" rel="stylesheet" media="screen">
    <script src="media/js/jquery-1.10.1.min.js"></script>
<!--    <script src="media/js/angular.min.js"></script>
    <script src="media/js/angular-resource.min.js"></script>-->
    <script type="text/javascript">

/*    var app = angular.module('Demo', ['ngResource'], angular.noop);
    app.controller('BookCtrl', function($scope, $resource){
        var actions = {
            create: {method: 'POST', params: {}},
            read: {method: 'GET', params: {}},
            update: {method: 'PUT', params: {}},
            delete: {method: 'DELETE', params: {}}
        };
        var Tag = $resource('/blog-admin/tag/:id', {id: '@id'}, actions);
//        var book = Tag.read({id: '1'}, function(response){
//            console.log(response);
//        });
        var p = {name: '测试', count: 1};
        var book = Tag.create({name: '测试', count: 1}, function(response){
            console.log(response);
        });

    });*/
$(function () {
    /*$.post('/blog-admin/tag/', {'tag.name': '测试', 'tag.count': 1}, function (data, status) {

    }, 'json');*/

    $.ajax({url:'/blog-admin/tag/',data:{'name': 'ceshi', 'count': 1},type:'POST',dataType:'json',contentType:'application/json;charset=utf-8'})
})



    </script>
</head>
<body>
<div ng-controller="BookCtrl">
    <div class="row">
        <div class="span4">ID</div>
        <div class="span4">名称</div>
        <div class="span4">使用次数</div>
    </div>
    <div class="row">
        <div class="span4">{{ book.id }}</div>
        <div class="span4">{{ book.name }}</div>
        <div class="span4">{{ book.count }}</div>
    </div>
</div>
</body>
</html>